package com.wx.exception;

import org.springframework.http.HttpStatus;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver;
import com.wx.controller.AnnotationController;

import java.util.Map;

/**
 * 自定义用注解 @ResponseStatus 标注的异常;
 * 假如在业务逻辑中抛出这个异常，并且容器中注册了 {@link ResponseStatusExceptionResolver} 异常解析器，
 * 那么这个异常会被这个异常解析器处理。
 *
 * 测试业务逻辑抛出此异常 {@link AnnotationController#customException(Map, Model)}
 */
@ResponseStatus(code = HttpStatus.BAD_REQUEST, reason = "请求参数为 null")
public class RequestParamEmptyException extends RuntimeException {

	private static final long serialVersionUID = 459632L;

	public RequestParamEmptyException() {
		super();
	}

	public 	RequestParamEmptyException(String message) {
		super(message);
	}
}
